import java.sql.Connection;
import java.sql.DriverManager;
import java.util.Arrays;
import java.util.Random;
import java.util.function.*;

public class Test {
    public static void main(String[] args) {
        /**
         *         Function<Integer,String> func = a -> String.valueOf(a);
         *         String s = func.apply(99);
         *         System.out.println("s="+s);
         */


        /**
         *         Function<Integer,String> func = String::valueOf;
         *         String s = func.apply(99);
         *         System.out.println("s="+s);
         */

        /**
         *         Consumer<String> consumer = s1 -> System.out.println(s1);
         *         consumer.accept("java");
         */

        /**
         *         Consumer<String> consumer = System.out::println;
         *         consumer.accept("Hello Nicy");
         */

        /**
         *         BiFunction<Integer,Integer,Double> func = (a,b) -> Math.pow(a,b);
         *         Double result = func.apply(3,4);
         *         System.out.println("result = " + result);
         */

        /**
         *         BiFunction<Integer,Integer,Double> func = Math::pow;
         *         Double result = func.apply(3,4);
         *         System.out.println("result="+result);
         */


        /**
         *         Random random = new Random();
         *         IntUnaryOperator func = i -> random.nextInt();
         *         Integer r = func.applyAsInt(10);
         *         System.out.println("r = "+ r);
         */


        /**
         *         Random random = new Random();
         *         IntUnaryOperator func = random::nextInt;
         *         Integer r = func.applyAsInt(10);
         *         System.out.println("r="+r);
         */


        /**
         *         String[] stringsArray = {"Barbara", "Mary", "James"};
         *         Arrays.sort(stringsArray,String.CASE_INSENSITIVE_ORDER);
         *         System.out.println(Arrays.toString(stringsArray));
         */


        /**
         *         String[] stringArray = {"Barbara", "Mary", "James"};
         *         Arrays.sort(stringArray,String::compareToIgnoreCase);
         *         System.out.println(Arrays.toString(stringArray));
         */


        /**
         *         Supplier<Cat> supplier = () -> new Cat();
         *         Cat cat = supplier.get();
         *
         *         System.out.println(cat);
         */


        /**
         *         Supplier<Cat> supplier = Cat::new;
         *         Cat cat = supplier.get();
         */

        /**
         *         Supplier<Connection> supplier = () ->{
         *           Connection con = null;
         *           try{
         *               con = DriverManager.getConnection("","","");
         *           }catch (Exception e){
         *               e.printStackTrace();
         *           }
         *
         *           return con;
         *         };
         *
         *         Connection connection = supplier.get();
         *         System.out.println(connection);
         */



    }
}
